<div class="stocks view">
<h2><?php echo __('Stock'); ?></h2>
	<dl>
		<dt><?php echo __('Id'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['id']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Chassis No'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['chassis_no']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Year'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['year']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Categoty'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['categoty']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Make'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['make']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Model'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['model']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Transm'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['transm']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Weight'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['weight']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Drive'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['drive']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('User New'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['user_new']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Doors'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['doors']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Country'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['country']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Engine Type'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['engine_type']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Fuel'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['fuel']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Engine No'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['engine_no']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('His Code'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['his_code']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Location'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['location']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Showroom'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['showroom']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Options'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['options']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Other Ref'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['other_ref']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Mileage'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['mileage']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Int Color'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['int_color']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Auc Grade'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['auc_grade']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Global Loc'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['global_loc']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Showonweb'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['showonweb']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Seats'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['seats']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Priority'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['priority']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Selling Price'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['selling_price']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Auction Ref'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['auction_ref']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Vh Cc'); ?></dt>
		<dd>
			<?php echo h($stock['Stock']['vh_cc']); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Stock'), array('action' => 'edit', $stock['Stock']['id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Delete Stock'), array('action' => 'delete', $stock['Stock']['id']), null, __('Are you sure you want to delete # %s?', $stock['Stock']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Stocks'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Stock'), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Attachments'), array('controller' => 'attachments', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Attachment'), array('controller' => 'attachments', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Deliveries'), array('controller' => 'deliveries', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Delivery'), array('controller' => 'deliveries', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Purchases'), array('controller' => 'purchases', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Purchase'), array('controller' => 'purchases', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Sales'), array('controller' => 'sales', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Sale'), array('controller' => 'sales', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php echo __('Related Attachments'); ?></h3>
	<?php if (!empty($stock['Attachment'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Attach Name'); ?></th>
		<th><?php echo __('Attach Path'); ?></th>
		<th><?php echo __('Stock Id'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php foreach ($stock['Attachment'] as $attachment): ?>
		<tr>
			<td><?php echo $attachment['id']; ?></td>
			<td><?php echo $attachment['attach_name']; ?></td>
			<td><?php echo $attachment['attach_path']; ?></td>
			<td><?php echo $attachment['stock_id']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'attachments', 'action' => 'view', $attachment['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'attachments', 'action' => 'edit', $attachment['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'attachments', 'action' => 'delete', $attachment['id']), null, __('Are you sure you want to delete # %s?', $attachment['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Attachment'), array('controller' => 'attachments', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Deliveries'); ?></h3>
	<?php if (!empty($stock['Delivery'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Paper Ready'); ?></th>
		<th><?php echo __('Paper Taken'); ?></th>
		<th><?php echo __('Taken By Contact'); ?></th>
		<th><?php echo __('Taken By Name'); ?></th>
		<th><?php echo __('Do Issued'); ?></th>
		<th><?php echo __('Car Taken'); ?></th>
		<th><?php echo __('Car Taken Contact'); ?></th>
		<th><?php echo __('Comments'); ?></th>
		<th><?php echo __('Stock Id'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php foreach ($stock['Delivery'] as $delivery): ?>
		<tr>
			<td><?php echo $delivery['id']; ?></td>
			<td><?php echo $delivery['paper_ready']; ?></td>
			<td><?php echo $delivery['paper_taken']; ?></td>
			<td><?php echo $delivery['taken_by_contact']; ?></td>
			<td><?php echo $delivery['taken_by_name']; ?></td>
			<td><?php echo $delivery['do_issued']; ?></td>
			<td><?php echo $delivery['car_taken']; ?></td>
			<td><?php echo $delivery['car_taken_contact']; ?></td>
			<td><?php echo $delivery['comments']; ?></td>
			<td><?php echo $delivery['stock_id']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'deliveries', 'action' => 'view', $delivery['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'deliveries', 'action' => 'edit', $delivery['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'deliveries', 'action' => 'delete', $delivery['id']), null, __('Are you sure you want to delete # %s?', $delivery['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Delivery'), array('controller' => 'deliveries', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Purchases'); ?></h3>
	<?php if (!empty($stock['Purchase'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Purchase Price1'); ?></th>
		<th><?php echo __('Purchase Price2'); ?></th>
		<th><?php echo __('Freight1'); ?></th>
		<th><?php echo __('Freight2'); ?></th>
		<th><?php echo __('Buying'); ?></th>
		<th><?php echo __('Ducamz Value'); ?></th>
		<th><?php echo __('Vendor Name'); ?></th>
		<th><?php echo __('Purchase Ref No'); ?></th>
		<th><?php echo __('Purchase By'); ?></th>
		<th><?php echo __('Pur Date'); ?></th>
		<th><?php echo __('Ship Date'); ?></th>
		<th><?php echo __('Ship Name'); ?></th>
		<th><?php echo __('Bl No'); ?></th>
		<th><?php echo __('Cont No'); ?></th>
		<th><?php echo __('Bol 1'); ?></th>
		<th><?php echo __('Stock Type'); ?></th>
		<th><?php echo __('Arrival Date'); ?></th>
		<th><?php echo __('Control No'); ?></th>
		<th><?php echo __('Total Exp'); ?></th>
		<th><?php echo __('Buyer Company'); ?></th>
		<th><?php echo __('Buyer Contact'); ?></th>
		<th><?php echo __('Third Party'); ?></th>
		<th><?php echo __('Transport Date'); ?></th>
		<th><?php echo __('Transport Company'); ?></th>
		<th><?php echo __('Repair Company'); ?></th>
		<th><?php echo __('Repair Date'); ?></th>
		<th><?php echo __('Stock Id'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php foreach ($stock['Purchase'] as $purchase): ?>
		<tr>
			<td><?php echo $purchase['id']; ?></td>
			<td><?php echo $purchase['purchase_price1']; ?></td>
			<td><?php echo $purchase['purchase_price2']; ?></td>
			<td><?php echo $purchase['freight1']; ?></td>
			<td><?php echo $purchase['freight2']; ?></td>
			<td><?php echo $purchase['buying']; ?></td>
			<td><?php echo $purchase['ducamz_value']; ?></td>
			<td><?php echo $purchase['vendor_name']; ?></td>
			<td><?php echo $purchase['purchase_ref_no']; ?></td>
			<td><?php echo $purchase['purchase_by']; ?></td>
			<td><?php echo $purchase['pur_date']; ?></td>
			<td><?php echo $purchase['ship_date']; ?></td>
			<td><?php echo $purchase['ship_name']; ?></td>
			<td><?php echo $purchase['bl_no']; ?></td>
			<td><?php echo $purchase['cont_no']; ?></td>
			<td><?php echo $purchase['bol_1']; ?></td>
			<td><?php echo $purchase['stock_type']; ?></td>
			<td><?php echo $purchase['arrival_date']; ?></td>
			<td><?php echo $purchase['control_no']; ?></td>
			<td><?php echo $purchase['total_exp']; ?></td>
			<td><?php echo $purchase['buyer_company']; ?></td>
			<td><?php echo $purchase['buyer_contact']; ?></td>
			<td><?php echo $purchase['third_party']; ?></td>
			<td><?php echo $purchase['transport_date']; ?></td>
			<td><?php echo $purchase['transport_company']; ?></td>
			<td><?php echo $purchase['repair_company']; ?></td>
			<td><?php echo $purchase['repair_date']; ?></td>
			<td><?php echo $purchase['stock_id']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'purchases', 'action' => 'view', $purchase['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'purchases', 'action' => 'edit', $purchase['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'purchases', 'action' => 'delete', $purchase['id']), null, __('Are you sure you want to delete # %s?', $purchase['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Purchase'), array('controller' => 'purchases', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Sales'); ?></h3>
	<?php if (!empty($stock['Sale'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Customer Name'); ?></th>
		<th><?php echo __('Customer No'); ?></th>
		<th><?php echo __('Sold Date'); ?></th>
		<th><?php echo __('Sale Price'); ?></th>
		<th><?php echo __('Bal Due'); ?></th>
		<th><?php echo __('Paid'); ?></th>
		<th><?php echo __('Export To'); ?></th>
		<th><?php echo __('Portofdisc'); ?></th>
		<th><?php echo __('Exit Point'); ?></th>
		<th><?php echo __('Stock Id'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php foreach ($stock['Sale'] as $sale): ?>
		<tr>
			<td><?php echo $sale['id']; ?></td>
			<td><?php echo $sale['customer_name']; ?></td>
			<td><?php echo $sale['customer_no']; ?></td>
			<td><?php echo $sale['sold_date']; ?></td>
			<td><?php echo $sale['sale_price']; ?></td>
			<td><?php echo $sale['bal_due']; ?></td>
			<td><?php echo $sale['paid']; ?></td>
			<td><?php echo $sale['export_to']; ?></td>
			<td><?php echo $sale['portofdisc']; ?></td>
			<td><?php echo $sale['exit_point']; ?></td>
			<td><?php echo $sale['stock_id']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'sales', 'action' => 'view', $sale['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'sales', 'action' => 'edit', $sale['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'sales', 'action' => 'delete', $sale['id']), null, __('Are you sure you want to delete # %s?', $sale['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Sale'), array('controller' => 'sales', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
